package com.shop.loan.model.vo;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class FileCodeVo {

    private Long orderId;

    private String lendUserName;
    private String lendUserIdCardNum;
    private String lendUserMobile;

    private String borrowerUserName;
    private String borrowerUserIdCardNum;
    private String borrowerUserMobile;

    private String transferTypeStr;
    private String repayTypeStr;
    private String moneyBig;
    private BigDecimal money;
    private String loanStart;
    private String loanEnd;
    private String reason;
    private Integer yearRate;

    public FileCodeVo() {
    }

//    public FileCodeVo(SignOrder signOrder, UserByMybatis userByMybatis) {
//        if (signOrder.getLendUser() != null) {
//            this.lendUserName = signOrder.getLendUser().getName();
//            this.lendUserIdCardNum = EncryptUtil.decryptStrByAes(signOrder.getLendUser().getCardNumByEncrypt());
//            this.lendUserMobile = EncryptUtil.decryptStrByAes(signOrder.getLendUser().getMobileByEncrypt());
//        }
//
//        if (signOrder.getBorrowerUser() != null) {
//            this.borrowerUserName = signOrder.getBorrowerUser().getCardName();
//            this.borrowerUserIdCardNum = EncryptUtil.decryptStrByAes(userByMybatis.getCardNumByEncrypt());
//            this.borrowerUserMobile = EncryptUtil.decryptStrByAes(userByMybatis.getMobileByEncrypt());
//        }
//
//        this.orderId = signOrder.getOrderId();
//        this.transferTypeStr = SignOrderUtil.getTransferTypeStr(signOrder.getTransferType());
//        this.repayTypeStr = SignOrderUtil.getRepayTypeStr(signOrder.getRepayType());
//        this.moneyBig = SignOrderUtil.digitUppercase(signOrder.getMoney().doubleValue());
//        this.money = signOrder.getMoney();
//        this.loanStart = DateUtil.format(signOrder.getLoanStart(), "yyyy年MM月dd日");
//        this.loanEnd = DateUtil.format(signOrder.getLoanEnd(), "yyyy年MM月dd日");
//        this.reason = SignOrderUtil.getReasonStr(signOrder.getReason());
//        this.yearRate = signOrder.getYearRate();
//    }
}
